package com.yitao.cms.service.order;

import com.querydsl.core.types.Order;
import com.querydsl.core.types.OrderSpecifier;
import com.skipper.base.service.GenericEntityService;
import com.yitao.client.dto.order.MallOrderDeliveryDetailDto;
import com.yitao.client.model.order.MallOrderDeliveryDetailModel;
import com.yitao.client.model.order.QMallOrderDeliveryDetailModel;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import java.util.List;

/**
 * @Auther: TUO
 * @Date: 2019/7/3 19:33
 * @Description:
 */
@Service
public class CmsOrderDeliveryDetailService extends GenericEntityService<MallOrderDeliveryDetailModel, MallOrderDeliveryDetailDto, QMallOrderDeliveryDetailModel> {

    public CmsOrderDeliveryDetailService(EntityManager entityManager) {
        super(entityManager);
    }

    public List<MallOrderDeliveryDetailModel> getDeliveryStr(String nu){
       List<MallOrderDeliveryDetailModel> list = repository.findAll(Q.nu.eq(nu) , new OrderSpecifier<>(Order.DESC, Q.ftime));
       return list;
    }
}
